import request from '@/utils/request'

// 查询资讯列表
export function listNews(query) {
  return request({
    url: '/business/news/list',
    method: 'get',
    params: query
  })
}

// 查询资讯详细
export function getNews(id) {
  return request({
    url: '/business/news/' + id,
    method: 'get'
  })
}

// 新增资讯
export function addNews(data) {
  return request({
    url: '/business/news',
    method: 'post',
    data: data
  })
}

// 修改资讯
export function updateNews(data) {
  return request({
    url: '/business/news',
    method: 'put',
    data: data
  })
}

// 删除资讯
export function delNews(id) {
  return request({
    url: '/business/news/' + id,
    method: 'delete'
  })
}

// 提交资讯供审批
export function submitNews(id) {
  return request({
    url: '/business/news/submit/' + id,
    method: 'delete'
  })
}

// 审批通过资讯
export function passNews(id) {
  return request({
    url: '/business/news/pass/' + id,
    method: 'delete'
  })
}

// 反审批退回资讯
export function backNews(id) {
  return request({
    url: '/business/news/back/' + id,
    method: 'delete'
  })
}

// 导出资讯
export function exportNews(query) {
  return request({
    url: '/business/news/export',
    method: 'get',
    params: query
  })
}
